package action;

import net.sf.json.JSONObject;

import org.json.JSONArray;

import com.opensymphony.xwork2.ActionSupport;

public class tt extends ActionSupport {

	private String name;
    private JSONObject result;

    // ajax请求参数赋值
    public void setName(String name) {
        this.name = name;
    }

    // ajax返回结果
    public JSONObject getResult() {
        return result;
    }

    public String execute() {
    	System.out.println("yes");
    	String html="{"+
    		"\"total\":239,"+                                                      
    		"\"rows\":[ "+                                                        
    			"{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"},"+        
    		  "{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"},"+ 
    	"{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"},  "+
    	"{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"},"+  
    	"{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"}, "+ 
    	"{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"}, "+ 
    	"{\"itemid\":\"001\",\"productid\":\"Name 1\",\"listprice\":\"Address 1\",\"unitcost\":\"col4 data\"}"+  
    	"	] "+                                                         
    	"} ";
    	try
    	{
    		/*JSONObject results=new JSONObject();
    	results.put("checkbox", "001");
    	results.put("title", "Name");
    	results.put("city", "Address");
    	results.put("category", "Address");
    	results.put("price", "Address");
    	results.put("startTime", "Address");
    	results.put("endTime", "Address");
    	results.put("delete", "Address");
    	
    	
    	JSONArray array=new JSONArray();
    	   array.put(results);*/
    	   
    	result=new JSONObject();
    	result.put("total", "239");
    	result.put("rows", "123");
    	  System.out.println(result.get("total"));
    	}catch(Exception e)
    	{
    		
    	}
    
        return "success";
    }


}
